<?php

use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;

$this->title = Yii::t('app', 'car Brands');
$this->params['breadcrumbs'][] = $this->title;
?>
<p>
    <a href="<?php echo Url::to(['car-list', 'id' => $brand_id, 'title' => $title]); ?>" class="btn btn-danger">返回上一级</a>
</p>
<h1><?= Html::encode($title) ?></h1>
<p>
    <a href="<?php echo Url::to(['car-info-add', 'model_id' => $model_id, 'brand_id' => $brand_id, 'title' => $title]); ?>" class="btn btn-success">新增</a>
    <a href="<?php echo Url::to(['info-edit', 'id' => $model_id, 'brand_id' => $brand_id, 'title' => $title]); ?>" class="btn btn-primary">更新</a>
</p>
<form name="listform" method="post">
    <table class="table table-striped table-bordered">
        <tr class="filters">
            <th>名称</th>
            <th>版本</th>
            <th>车型</th>
            <th>操作</th>
        </tr>
        <?php foreach ($data as $value): ?>
        <tr class="hover">
            <td><?php echo $value->name; ?></td>
            <td><?php echo $value->content; ?></td>
            <td><?php echo $value->edition; ?></td>
            <td>
                <a href="<?php echo Url::to(['car-info-view', 'id' => $value->id, 'model_id' => $model_id, 'brand_id' => $brand_id, 'title' => $title]); ?>" class="btn btn-info" >
                    详情
                </a>
                <a href="<?php echo Url::to(['car-info-edit', 'id' => $value->id, 'model_id' => $model_id, 'brand_id' => $brand_id, 'title' => $title]); ?>" class="btn btn-primary">
                    更新
                </a>
                <a href="<?php echo Url::to(['car-info-image', 'id' => $value->id, 'model_id' => $model_id, 'brand_id' => $brand_id, 'title' => $title]); ?>" class="btn btn-warning">
                    查看图片
                </a>
            </td>
        </tr>
        <?php endforeach; ?>
    </table>
    <?php if (empty($data)): ?>
        <div class="no-result">暂无记录</div>
    <?php endif; ?>
</form>
